import { createWebHistory, createRouter } from 'vue-router'

import Home from "../views/Home.vue";
import Layout from "../views/Layout.vue";
import LUL from "../views/LUL.vue";
import AiW from "../views/AiW.vue";
import Type from "../views/Type.vue";
import Me from "../views/Me.vue";
import Login from "../views/Login.vue";
import Register from "../views/Register.vue";
import FindPass from "../views/FindPass.vue";
import Sc from "../views/Sc.vue";
import AllBook from "../views/AllBook.vue";
import AddBook from "../views/AddBook.vue";
import UpdateBook from "../views/UpdateBook.vue";

export const constantRoutes = [
    {
        path: "/layout",
        component: Layout,
        children:[
            { path: '/', component: Home },
            { path: '/type', component: Type },
            { path: '/me', component: Me },
        ]
    },
    { path: '/login', component: Login },
    { path: '/updateBook', component: UpdateBook},
    { path: '/addBook', component: AddBook },
    { path: '/allBook', component: AllBook },
    { path: '/sc', component: Sc },
    { path: '/findPass', component: FindPass },
    { path: '/register', component: Register },
    { path: '/lul', component: LUL },
    { path: '/aiw', component: AiW },
]

const router = createRouter({
    history: createWebHistory(),
    routes: [...constantRoutes]
})

export default router;